package com.ai.model.comparator;

import java.util.Comparator;

import com.ai.model.edu.cms.section.SectionInfo;

public class SectionInfoComparator implements Comparator<SectionInfo> {

    @Override
    public int compare(SectionInfo one, SectionInfo other) {
        if(one.getIsDelete() != null) {
            if(one.getIsDelete().equals(other.getIsDelete())) {
                return one.getSort().compareTo(other.getSort());
            } else {
                return one.getIsDelete().compareTo(other.getIsDelete());
            }
        } else {
            return 1;
        }
    }

}
